package com.pcbly.web.components.utils.random;

/**
 * A class that wraps the Guid(Global Unique Identifier), which
 * is used to represent a unique info
 *
 * <p> Copyright (c) 2003</p>
 * <p> Jebey Enterprises Ltd.</p>
 * @author George Mu
 * @version 1.0
 */

public final class GUID implements java.io.Serializable
{
    /**
	 * 
	 */
	private static final long serialVersionUID = 7117543619293203972L;
	private String mGuidValue;
    private boolean mSecured;

    public GUID(){
      mGuidValue = RandomGuidGenerator.generateGuid(false);
      mSecured = false;
    }

    public GUID(boolean pSecured){
      mGuidValue = RandomGuidGenerator.generateGuid(pSecured);
      mSecured = pSecured;
    }

    public GUID(String pGuid){
      mGuidValue = pGuid;
      mSecured = false;
    }

    public GUID(String pGuid, boolean pSecured){
      mGuidValue = pGuid;
      mSecured = pSecured;
    }

    public boolean isSecured(){
      return mSecured;
    }

    public boolean equals(GUID pGuid){
      return mGuidValue.equals(pGuid.toString());
    }

    public String toString(){
      return mGuidValue;
    }
    public  static void main(String[] args){
    	for(int i=0;i<50;i++){
    		System.out.println((new GUID()).toString());
    	}
    }
}
